#ifndef GOOGLETTS_H
#define GOOGLETTS_H

#include <QString>
#include <QObject>
#include <QMediaPlayer>
#include <QMediaPlaylist>

#define LENGTH_LIMIT 100


class GoogleTTS : public QObject
{
    Q_OBJECT
public:
    GoogleTTS(QString language);
    void setLanguage(QString language);
    void Speak(QString text);
    ~GoogleTTS();

private:
    void vPlayShortText(QString sShortText);
    QString m_language;
    QMediaPlaylist *m_playlist;
    QMediaPlayer *m_player;
    QString m_url;

private slots:
    void PlayerFinished(QMediaPlayer::State newState);

signals:
    void SpeakingFinished();
};

#endif // GOOGLETTS_H
